package com.ruoyi.nongjt.service.impl;

import com.ruoyi.nongjt.domain.PrinterSerialNumber;
import com.ruoyi.nongjt.mapper.PrinterSerialNumberMapper;
import com.ruoyi.nongjt.service.PrinterSerialNumberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

// PrinterSerialNumberServiceImpl.java
@Service
public class PrinterSerialNumberServiceImpl implements PrinterSerialNumberService {

    @Autowired
    private PrinterSerialNumberMapper printerSerialNumberMapper;

    @Override
    public PrinterSerialNumber addPrinter(String serialNumber) {
        PrinterSerialNumber printer = new PrinterSerialNumber();
        printer.setSerialNumber(serialNumber);
        printer.setIsUsed(0);
        printerSerialNumberMapper.insert(printer);
        return printer;
    }

    @Override
    public PrinterSerialNumber getPrinterById(Long id) {
        return printerSerialNumberMapper.selectById(id);
    }
}

